"Hello, World!" script

We have already examined an example of the "Hello, World!" report; now let us view, how to create a simplest script, which would display a window with a greeting.

Let us create a blank project in Delphi. Put the "TfrxReport" component to the form. Enter the designer and click on the "New report" button for FastReport to automatically create a blank template. Switch to the "Code" bookmark and write the following script:

begin
ShowMessage('Hello, World!');
end.

After that, run the report. As we expected, FastReport displays a little window with a greeting:

Let us explain some details. We created a script consisting of a single "begin..end" block. Thus, our script has a very simple structure; it consists of a main procedure only (see the "Structure of a script" chapter). The main procedure is executed as soon as the report runs. In our case, it displays a greeting window; the procedure ends right after the window is closed. After the main procedure finished, report building starts.